/* ----------------------------- Noble Steed Engine----------------------------*
Authors : Daniel Randle, Alex Bourne
Date Created : Mar 16 2013

File:
	nsshaderset.h

Description:
	This file contains the NSShaderSet class which is the base container class for all
	the shaders in the game.
*---------------------------------------------------------------------------*/

#ifndef NSSHADERSET_H
#define NSSHADERSET_H

/* ---------------------------------Class NSShaderSet-----------------------------*

Description:
	NSShaderSet will provide all the needed virtual functions for other deriving classes to use

*-------------------------------------------------------------------------------*/

// includes
#include <vector>
#include <nsmath3d.h>
#include <nsshader.h>

// Forward Declarations
class NSShader;
class NSObjectSet;

class NSShaderSet
{
public:
	typedef std::vector<NSShader*>::iterator Iterator;

	NSShaderSet(NSObjectSet * objects);
	~NSShaderSet();

	void addShader(NSShader * shader);
	NSShader * addShader(NSShader::ShaderProgType type, 
		const std::string & _shaderID, 
		const std::string & fragmentFileName, 
		const std::string & vertexFileName, 
		const std::string & geometryFileName = "", 
		const std::string & shaderDirectory = "Shaders");

	NSShader * getShader(unsigned int progID);
	NSShader * getShader(const std::string & shaderID);

	bool removeShader(NSShader * shader);
	bool removeShader(unsigned int progID);
	bool removeShader(const std::string & shaderID);
	
	void setAllUniforms(const char * variableName, const NSMatrix4Df & data) const;
	void setAllUniforms(const char * variableName, const NSMatrix3Df & data) const;
	void setAllUniforms(const char * variableName, const NSVec4Df & data) const;
	void setAllUniforms(const char * variableName, const NSVec3Df & data) const;
	void setAllUniforms(const char * variableName, const NSVec2Df & data) const;
	void setAllUniforms(const char * variableName, float dat) const;
	void setAllUniforms(const char * variableName, int data) const;
	void setAllUniforms(const char * variableName, unsigned int data) const;

	Iterator begin();
	Iterator end();

private:
	std::vector<NSShader*> shaders;
	NSObjectSet * objectSet;
};

#endif